# encoding: utf-8

from typing import List, Dict
import requests

ali_ner_api = "http://192.168.0.170:10001/ner-api"


def extract_one(text: str) -> dict:
    data = {"text": text}

    response = requests.post(url=ali_ner_api, json=data)

    return response.json()


def extract_batch(texts: List[str]) -> List[Dict]:
    data = {"texts": texts}
    response = requests.post(url=ali_ner_api, json=data)

    return response.json()
